# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Contributor: Alexey Minnekhanov <alexeymin@postmarketos.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=qt-creator
pkgver=7.0.2
pkgrel=1
pkgdesc="Lightweight and cross-platform C++ IDE"
url="https://qt-project.org/wiki/Category:Tools::QtCreator"
arch="x86_64 aarch64" # qt6-qtwebengine
license="GPL-3.0-only WITH Qt-GPL-exception-1.0"
depends="
	qt6-qtbase-sqlite
	qt6-qtbase-dev
	qt6-qttools-dev
"
makedepends="
	botan-dev
	clang-dev
	clang-static
	cmake
	elfutils-dev
	llvm14-dev
	llvm14-static
	qt6-qt5compat-dev
	qt6-qtdeclarative-dev
	qt6-qtquick3d-dev
	qt6-qtserialport-dev
	qt6-qtshadertools-dev
	qt6-qtsvg-dev
	qt6-qtwebengine-dev
	samurai
"
ldpath="/usr/lib/qtcreator:/usr/lib/qtcreator/plugins"
source="
	https://download.qt.io/official_releases/qtcreator/${pkgver%.*}/$pkgver/qt-creator-opensource-src-$pkgver.tar.xz
	fix-execinfo.patch
	fix-malloc-trim.patch
	llvm-include.patch
"

builddir="$srcdir"/qt-creator-opensource-src-$pkgver

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QBS=OFF \
		-DBUILD_PLUGIN_CLANGFORMAT=ON
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
d3aa34b01a7cb2bd9def6b1eeaaaf280bc157f0e65f6b073cd8790cc275579958085514b244ea185d7215696b678f80c98650f063b1d24580bf35fe959bfbab8  qt-creator-opensource-src-7.0.2.tar.xz
702f014fc99bfba2576aa7459890afaad430638b2461059793884a3a527a05c73b58b649447e1f46b45c564f777aa7117581066b559dac896d082381057ef1b0  fix-execinfo.patch
4fbb9ad60622983c3ffb5600d374e76c2e21d1d8e1f0da255932c9c2e828c14ccc61c4065dd8cceff74088565a08f39685b29b9e2f767fc09773ac1ae89c4b60  fix-malloc-trim.patch
35f35c344e808589bdd8506bc95ba9ea2b98203d927f6cae491a1aee47ca0ab1440ffca2c4c4571803ac3038e522c0f2263e8cb046f200c80ae81a8ed70ac035  llvm-include.patch
"
